//
//  MeatCartTableViewCell.m
//  PigMarket
//
//  Created by 张敬 on 2019/7/23.
//  Copyright © 2019年 pigmarket.oc. All rights reserved.
//

#import "MeatCartTableViewCell.h"
#import "MeatShopRightModel.h"

@interface MeatCartTableViewCell()

@property (nonatomic, strong) UIImageView *shopIcon; //店铺Icon

@property (nonatomic, strong) UILabel *pigTypeTipLab;
@property (nonatomic, strong) UILabel *pigTypeNOLab;
@property (nonatomic, strong) UILabel *pigTypeWeightLab;
@property (nonatomic, strong) UILabel *pigTypePriceLab;
@property (nonatomic, strong) UILabel *pigTypePriceSignalLab;
@property (nonatomic, strong) UILabel *pigTypePriceCancelLab;

@property (nonatomic, strong) UILabel *newsText;        // 新闻文本
@property (nonatomic, strong) UILabel *foldLabel;       // 展开按钮
@property (nonatomic, strong) UIView *bottomSpaceView;  // 底部分割线

@end


@implementation MeatCartTableViewCell


- (void)setupUI
{
    self.clipsToBounds = YES;
    
    self.meatUIComponent.view = self.contentView;
}

- (void)setupLayout{
    
    self.meatUIComponent.type = MeatFoldUILayoutType_FullScreen;
}


#pragma mark - setter methods

- (void)setNewsModel:(MeatShopRightModel *)newsModel{
    
    _newsModel = newsModel;
    self.meatUIComponent.model = newsModel;
}


#pragma mark - getter methods

- (MeatFoldUIComponent *)meatUIComponent{
    
    if (!_meatUIComponent) {
        _meatUIComponent = [[MeatFoldUIComponent alloc] init];
        
        @weakify(self);
        _meatUIComponent.dealFlodBlock = ^{
            @strongify(self);
            if (self.cellDelegate && [self.cellDelegate respondsToSelector:@selector(clickFoldLabel:)]) {
                [self.cellDelegate clickFoldLabel:self];
            }
        };
        
        _meatUIComponent.chooseCartBlock = ^(UIButton *btn) {
            @strongify(self);
            if (self.chooseCartBlock) {
                self.chooseCartBlock(btn);
            }
        };
    }
    return _meatUIComponent;
}


@end
